package com.rabc.framework.factory;

import com.rabc.web.entity.SysOptionLog;
import com.rabc.web.service.SysOptionLogService;
import com.utils.SpringUtils;

import java.util.TimerTask;

public class AsyncFactory {




    /**
     * 操作日志记录
     *
     * @param operLog 操作日志信息
     * @return 任务task
     */
    public static TimerTask recordOper(final SysOptionLog operLog)
    {
        return new TimerTask()
        {
            @Override
            public void run()
            {
                // 远程查询操作地点
             //   operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
               SpringUtils.getBean(SysOptionLogService.class).insertOptionLog(operLog);
            }
        };
    }
}
